﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NCT.MRS.DataAccessLayer.Entities;

namespace NCT.MRS.DataAccessLayer.Configurations
{
    public class TestPackageConfiguration : EntityTypeConfiguration<TestPackage>
    {
        public TestPackageConfiguration()
        {
            HasKey(P => P.Id);
            Property(P => P.Name).IsRequired().HasMaxLength(30);
            Property(P => P.Price).IsRequired();
            HasMany(P => P.TestTypes).WithMany(P => P.TestPackages);
            HasRequired(P => P.ModifiedByUser).WithMany().HasForeignKey(P => P.ModifiedByUserId).WillCascadeOnDelete(false);
        }
    }
}
